﻿namespace Example
{
    using System;
    using System.Globalization;

    public sealed class CheckAmount
    {
        public CheckAmount(decimal value)
        {
            Value = value;
        }

        private decimal Value { get; set; }

        public override string ToString()
        {
            var dollars = new Dollar(Value);

            var cents = Convert.ToInt32((Value - dollars.Value) * 100);

            var result = string.Format(CultureInfo.InvariantCulture, "{0} and {1:00}/100 dollars", dollars, cents);

            return result[0].ToString().ToUpperInvariant() + result.Substring(1);
        }
    }
}